// locations to search for config files that get merged into the main config
// config files can either be Java properties files or ConfigSlurper scripts

// grails.config.locations = [ "classpath:${appName}-config.properties",
//                             "classpath:${appName}-config.groovy",
//                             "file:${userHome}/.grails/${appName}-config.properties",
//                             "file:${userHome}/.grails/${appName}-config.groovy"]

// if (System.properties["${appName}.config.location"]) {
//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }


facebook.applicationSecret= 'f88caa308cc5cb3dbd7a774884942a43'
facebook.applicationId= '198381490266951'

grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
                      xml: ['text/xml', 'application/xml'],
                      text: 'text/plain',
                      js: 'text/javascript',
                      rss: 'application/rss+xml',
                      atom: 'application/atom+xml',
                      css: 'text/css',
                      csv: 'text/csv',
                      all: '*/*',
                      json: ['application/json','text/json'],
                      form: 'application/x-www-form-urlencoded',
                      multipartForm: 'multipart/form-data'
                    ]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

// What URL patterns should be processed by the resources plugin
//grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']
grails.resources.adhoc.patterns = ['/css/*', '/js/*', '/plugins/*']


// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart=false

// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']

// enable query caching by default
grails.hibernate.cache.queries = true

// set per-environment serverURL stem for creating absolute links
environments {
    development {
        grails.logging.jul.usebridge = true
    }
    production {
        grails.logging.jul.usebridge = false
        // TODO: grails.serverURL = "http://www.changeme.com"
    }
}

// log4j configuration
log4j = {    
	
	appenders {
		file name:'file', file:'./grails.log'
	}
	
	// trace 'org.hibernate.type'
	// trace 'org.hibernate.SQL'
	
	root {
		info 'stdout', 'file'
		additivity = true
	}

    error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
           'org.codehaus.groovy.grails.web.pages', //  GSP
           'org.codehaus.groovy.grails.web.sitemesh', //  layouts
           'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
           'org.codehaus.groovy.grails.web.mapping', // URL mapping
           'org.codehaus.groovy.grails.commons', // core / classloading
           'org.codehaus.groovy.grails.plugins', // plugins
           'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
           'org.springframework',
           'org.hibernate',
           'net.sf.ehcache.hibernate'
}


simpleCaptcha {
	// font size used in CAPTCHA images
	fontSize = 30
	height = 200
	width = 200
	// number of characters in CAPTCHA text
	length = 6

	// amount of space between the bottom of the CAPTCHA text and the bottom of the CAPTCHA image
	bottomPadding = 0

	// distance between the diagonal lines used to obfuscate the text
	lineSpacing = 10

	// the charcters shown in the CAPTCHA text must be one of the following
	chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}

photos.path.notInHosting = "local"
photos.path.inHosting = "GCS"


gcs.appplication.localPrefix = "gcs_"


gcs.appplication.finishUploadUrl = "http://localhost:8080/RemoteFileHosting/registerUploadComplete"
gcs.commons.publicUrl = "http://commondatastorage.googleapis.com/"
gcs.commons.photosHostedUrl = "http://commondatastorage.googleapis.com/photo-admin-sandbox/"

grailsApplication.config.windowsConsolePrefix = "cmd /c"


//Shows preview
upload.preview.enabled = true;
online = false;


environments {
	development {
		// Google cloud storage configuration
		gcs.config.installedPath = "C:\\gsutil\\gsutil";
		gcs.config.commandTool = "D:\\SourcesWin\\Python2.7\\Program\\python C :\\gsutil\\gsutil ";
		
		//Sandbox location
		gcs.appplication.bucketName = "photo-admin-sandbox"
		gcs.appplication.bucketUrl = "gs://photo-admin-sandbox/"
		gcs.commons.photosHostedUrl = "http://commondatastorage.googleapis.com/photo-admin-sandbox/"
		grailsApplication.config.hostedInWindows = true		
		gcs.appplication.enabled = false;
		
		grails.mail.disabled=false		
		
		init.data.load=false
		init.photos.dir="C:\\Users\\Tomas\\Desktop\\FotosAlta"
		
		google.analytics.webPropertyID = "UA-37481870-1"
		
		
		grails.app.context = "/"
		//app.domain.url='http://www.imajoy.net'
		//grails.serverURL="http://www.imajoy.net"
		grails.serverURL="http://www.photoadminfiuba.com"
		app.domain.url='http://www.photoadminfiuba.com'
		//online = false;
		
	}
	test {
		grails.mail.disabled=false
		google.analytics.webPropertyID = "UA-37481870-1"
		
		// Google cloud storage configuration
		gcs.config.installedPath = "C:\\gsutil\\gsutil";
		gcs.config.commandTool = "D:\\SourcesWin\\Python2.7\\Program\\python C:\\gsutil\\gsutil ";
		
		//Sandbox location
		gcs.appplication.bucketName = "photo-admin-sandbox"
		gcs.appplication.bucketUrl = "gs://photo-admin-sandbox/"
		gcs.commons.photosHostedUrl = "http://commondatastorage.googleapis.com/photo-admin-sandbox/"
		grailsApplication.config.hostedInWindows = true		
		gcs.appplication.enabled = false;
		
		init.data.load=true
		init.photos.dir="C:\\Users\\Tomas\\Desktop\\FotosAlta"		
		grails.app.context = "/"
		grails.serverURL="http://www.photoadminfiuba.com"
		app.domain.url='http://www.photoadminfiuba.com'				
	}
	production {
		grails.mail.disabled=false
		google.analytics.webPropertyID = "UA-38832940-1"
		
		// Google cloud storage configuration
		gcs.config.installedPath = "/home/ubuntu/programs/gsutil/gsutil";
		gcs.config.commandTool = "/home/ubuntu/programs/gsutil/gsutil ";
		
		//Sandbox location
		gcs.appplication.bucketName = "photo-admin-app"
		gcs.appplication.bucketUrl = "gs://photo-admin-app/"
		gcs.commons.photosHostedUrl = "http://commondatastorage.googleapis.com/photo-admin-app/"
		gcs.appplication.enabled = false;
		grailsApplication.config.hostedInWindows = false
		
		
		
		init.data.load=false
		init.photos.dir="/home/ubuntu/FotosAlta"
		//init.photos.dir="/home/ubuntu/PocasFotos"
		
					
		grails.app.context = "/"
		
		//Produccion 1
		//grails.serverURL="http://ec2-177-71-151-137.sa-east-1.compute.amazonaws.com"
		//app.domain.url="http://ec2-177-71-151-137.sa-east-1.compute.amazonaws.com"
		
		// Produccion medium
		//grails.serverURL="http://ec2-54-234-162-188.compute-1.amazonaws.com/"
		//app.domain.url="http://ec2-54-234-162-188.compute-1.amazonaws.com/"
		grails.serverURL="http://imajoy.com.ar"
		app.domain.url="http://imajoy.com.ar"
		grails.serverURL="http://192.241.178.234"
		app.domain.url="http://192.241.178.234"
	}
}



// Spring security plugin
facebook.security.filter.url="j_facebook_security_check"

grails.plugins.springsecurity.useBasicAuth = true

grails.plugins.springsecurity.userLookup.userDomainClassName = 'ar.com.photo_admin.domain.User'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'ar.com.photo_admin.domain.UserRole'
grails.plugins.springsecurity.authority.className = 'ar.com.photo_admin.domain.Role'

grails.plugins.springsecurity.providerNames = ['facebookAutenticationProvider', 'daoAuthenticationProvider','anonymousAuthenticationProvider', 'rememberMeAuthenticationProvider']
grails.plugins.springsecurity.filterChain.filterNames = [
	'securityContextPersistenceFilter', 'logoutFilter',	'authenticationProcessingFilter', 'facebookAuthenticationProcessingFilter', 'rememberMeAuthenticationFilter', 'anonymousAuthenticationFilter', 'exceptionTranslationFilter', 'filterInvocationInterceptor' ]


grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
	xml: ['text/xml', 'application/xml'],
	text: 'text-plain',
	js: 'text/javascript',
	rss: 'application/rss+xml',
	atom: 'application/atom+xml',
	css: 'text/css',
	csv: 'text/csv',
	pdf: 'application/pdf',
	rtf: 'application/rtf',
	excel: 'application/vnd.ms-excel',
	ods: 'application/vnd.oasis.opendocument.spreadsheet',
	all: '*/*',
	json: ['application/json','text/json'],
	form: 'application/x-www-form-urlencoded',
	multipartForm: 'multipart/form-data'
  ]


//Configuracion del mail.
grails.mail.host = "smtp.gmail.com"
grails.mail.port = "465"
grails.mail.username = "tpfiuba2013@gmail.com"
grails.mail.password = "fotos2013"
grails.mail.props = ["mail.smtp.auth": "true",
        "mail.smtp.socketFactory.port": "465",
        "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
        "mail.smtp.socketFactory.fallback": "false",
        "mail.smtp.starttls.enable": "true",
        "mail.debug": "true"]

